<template>
  <ant-modal
    modalWidth="576"
    modalHeight="500"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="参数名称" prop="paramName">
            <a-input v-model="form.paramName" placeholder="请输入参数名称"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12" >
          <a-form-model-item label="参数类型" prop="paramType">
            <a-select
              placeholder="请选择参数类型"
              v-model="form.paramType"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode || document.body
                }
              "
              style="width: 100%"
              allow-clear>
              <a-select-option v-for="(d, index) in paramTypeOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="参数值" prop="paramValue">
            <a-input v-model="form.paramValue" placeholder="请输入参数值"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="最大值" prop="paramMax">
            <a-input v-model="form.paramMax" placeholder="请输入最大值"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="最小值" prop="paramMin">
            <a-input v-model="form.paramMin" placeholder="请输入最小值"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12" >
          <a-form-model-item label="状态" prop="state">
            <a-select
              placeholder="请选择状态"
              v-model="form.state"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode || document.body
                }
              "
              style="width: 100%"
              allow-clear>
              <a-select-option v-for="(d, index) in stateOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="备注" prop="remark">
            <a-input v-model="form.remark" placeholder="请输入备注"/>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import SysParamsAddForm from './SysParamsForm'
export default {
  ...SysParamsAddForm
}
</script>
